Skip to content

Batch cppcheck invocation in pre-commit hook#28

Merged
jserv merged 1 commit intomainfrom
refine-hooks
Mar 27, 2026
Merged

Batch cppcheck invocation in pre-commit hook#28
jserv merged 1 commit intomainfrom
refine-hooks

Conversation

@jserv
Copy link
Copy Markdown
Contributor

@jserv jserv commented Mar 27, 2026

This runs Cppcheck once with staged files instead of spawning separate process per file, replacing '--force' with '--max-configs=4' to cap configuration exploration while still covering all #ifdef branches present in the codebase (max observed: 5 configs).

Change-Id: Ieb674316a6d39fd5e5c046ff68c435791e59021e


Summary by cubic

Run cppcheck once on all staged C files in the pre-commit hook instead of per-file, reducing process overhead. Replace --force with --max-configs=4 to cap config exploration while keeping broad #ifdef coverage.

  • Refactors
    • Batch-invoke cppcheck with all existing staged files; skip missing files.
    • Switch from --force to --max-configs=4.
    • Simplify reporting to a single pass with a unified error result.

Written for commit 304f391. Summary will update on new commits.

This runs Cppcheck once with staged files instead of spawning separate
process per file, replacing '--force' with '--max-configs=4' to cap
configuration exploration while still covering all #ifdef branches
present in the codebase (max observed: 5 configs).

Change-Id: Ieb674316a6d39fd5e5c046ff68c435791e59021e
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@jserv jserv merged commit 47157b2 into main Mar 27, 2026
4 checks passed
@jserv jserv deleted the refine-hooks branch March 27, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant